﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BusinessHanler;

namespace BusinessHandler
{
    public class NewsPositionController : NewsDataClassesDataContext
    {
        private static NewsPositionController instance;
        public static NewsPositionController Instance
        {
            get
            {
                if (instance == null)
                    instance = new NewsPositionController();
                return instance;
            }
            set
            {
                instance = value;
            }
        }
        public List<NewsPosition> GetNewsPositionList()
        {
            NewsDataClassesDataContext dt = new NewsDataClassesDataContext();
            var list = (from tmp in dt.NewsPositions
                        orderby tmp.PositionName descending
                        select tmp).ToList();
            if (list != null)
            {
                return (List<NewsPosition>)list;
            }
            return new List<NewsPosition>(); 
        }
    }
}